#pragma once
#ifndef __ASSEMBLER__
#include "types.h"
#include "idt.h"

namespace real_thunk
{
  enum FUNCTION_TYPE
  {
    SET_VIDEO_MODE,
    GET_VIDEO_MODE,
    GET_VIDEO_MODE_AVAILABILITY,
    PUT_PIXEL,
    PIXEL_AT,
    READ_1SECTOR,
    WRITE_1SECTOR
  };

  #pragma pack (push, 1)
  struct real_thunk_params_header
  {
    uint8_t func_type;
  };
  #pragma pack (pop)

  #pragma pack (push, 1)
  struct set_video_mode_params
  {
    real_thunk_params_header hdr;
    uint8_t mode;
  };
  #pragma pack (pop)

  #pragma pack (push, 1)
  struct get_video_mode_availability_params
  {
    real_thunk_params_header hdr;
    uint8_t mode;
  };
  #pragma pack (pop)

  #pragma pack (push, 1)
  struct put_pixel_params
  {
    real_thunk_params_header hdr;
    uint8_t color;
    uint16_t x;
    uint16_t y;
  };
  #pragma pack (pop)

  #pragma pack (push, 1)
  struct pixel_at_params
  {
    real_thunk_params_header hdr;
    uint16_t x;
    uint16_t y;
  };
  #pragma pack (pop)

  #pragma pack (push, 1)
  struct read_1sector_params
  {
    real_thunk_params_header hdr;
    uint64_t sector_start;
    void* out;
  };
  #pragma pack (pop)

  #pragma pack (push, 1)
  struct write_1sector_params
  {
    real_thunk_params_header hdr;
    uint64_t sector_start;
    void* in;
  };
  #pragma pack (pop)

  uint func(void* params, uint32_t size);
}
#else
#define SET_VIDEO_MODE 0
#define GET_VIDEO_MODE 1
#define GET_VIDEO_MODE_AVAILABILITY 2
#define PUT_PIXEL 3
#define PIXEL_AT 4
#define READ_1SECTOR 5
#define WRITE_1SECTOR 6
#endif
